<?php
/**
 * Created by PhpStorm.
 * User: yy
 * Date: 2019/6/25
 * Time: 18:14
 */

namespace app\api\controller;

use app\common\service\weekAttention\WeekAttentionControlTraceService;

/**
 * 本周关注-管控跟踪
 * Class WeekAttentionControlTrace
 * @package app\api\controller
 */
class WeekAttentionControlTrace extends BaseController
{
    /**
     * 减排前、减排后、实测值
     * @author yy by 2019/7/1
     */
    public function getReduceForecast()
    {
        $param = $this->request->param();
        # 模拟数据
//        $param = ['start_time' => '2019-07-01', 'end_time' => '2019-07-07', 'plan_id' => '1','region_id'=>53, 'station_id' => 0, 'pollutant_name' => 'pm2.5'];
        $list  = [];
        try {
            $weekAttentionControlTraceService = new WeekAttentionControlTraceService();
            $list                           = $weekAttentionControlTraceService->getReduceForecast($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }

    /**
     * 平均运行浓度和效率
     * @author yy by 2019/6/25
     */
    public function getConcentrationEfficiency()
    {
        $param = $this->request->param();
        # 模拟数据
//        $param = ['start_time' => '2019-06-24', 'end_time' => '2019-06-30', 'plan_id' => '1', 'region_id' => 53, 'station_id' => 0, 'company_id'=>1,  'is_sulfur' => 1];
        $list  = [];
        try {
            $weekAttentionControlTraceService = new WeekAttentionControlTraceService();
            $list                             = $weekAttentionControlTraceService->getConcentrationEfficiency($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }

    /**
     * 管控企业运行趋势（减排前 减排后 实测值）
     * @author yy by 2019/6/26
     */
    public function getCompanyOperationTrend()
    {
        $param = $this->request->param();
        # 模拟数据
//        $param = ['start_time' => '2019-07-01', 'end_time' => '2019-07-07', 'plan_id' => '1', 'region_id' => 53, 'station_id' => 0, 'company_id'=>1,  'is_sulfur' => 1];
        $list  = [];
        try {
            $weekAttentionControlTraceService = new WeekAttentionControlTraceService();
            $list                             = $weekAttentionControlTraceService->getCompanyOperationTrend($param);
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
        $this->success('成功', $list);
    }


}